package cn.chinaiptv.apkmanager.dao;

import javax.servlet.jsp.tagext.TryCatchFinally;

import org.hibernate.Session;
import org.hibernate.Transaction;

import cn.chinaiptv.apkmanager.bean.LauncherAPK;

public class LauncherAPKDao {
	
	//增
	
	public boolean save(LauncherAPK entity){
		
		boolean result = false;
		Session session = null;
		Transaction tx = null;
		try{
			 session = CommonDaoFactory.sessionFactory.openSession();
			 tx = session.beginTransaction();
			 session.save(entity);
			 tx.commit();
			 result = true;
			}catch(Exception e){
				tx.rollback();
				result = false;
				e.printStackTrace();
				
			
		}finally{
			if(session!=null){
				if(session.isOpen()){
					session.close();
}
			}
			
		}
		
		
		return result;  
		  
		  

	}
	
	//删除
	//更新
	//查一个
	//查分页
	//查所有

}
